/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package br.ufrn.generativemodel.generativemodel.impl;

import br.ufrn.generativemodel.generativemodel.Aspect;
import br.ufrn.generativemodel.generativemodel.GenerativemodelPackage;

import java.util.Collection;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.util.EObjectResolvingEList;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Aspect</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link br.ufrn.generativemodel.generativemodel.impl.AspectImpl#getClassDependences <em>Class Dependences</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class AspectImpl extends AbstractDataImpl implements Aspect {
	/**
	 * The cached value of the '{@link #getClassDependences() <em>Class Dependences</em>}' reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClassDependences()
	 * @generated
	 * @ordered
	 */
	protected EList<br.ufrn.generativemodel.generativemodel.Class> classDependences;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected AspectImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GenerativemodelPackage.Literals.ASPECT;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<br.ufrn.generativemodel.generativemodel.Class> getClassDependences() {
		if (classDependences == null) {
			classDependences = new EObjectResolvingEList<br.ufrn.generativemodel.generativemodel.Class>(br.ufrn.generativemodel.generativemodel.Class.class, this, GenerativemodelPackage.ASPECT__CLASS_DEPENDENCES);
		}
		return classDependences;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GenerativemodelPackage.ASPECT__CLASS_DEPENDENCES:
				return getClassDependences();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GenerativemodelPackage.ASPECT__CLASS_DEPENDENCES:
				getClassDependences().clear();
				getClassDependences().addAll((Collection<? extends br.ufrn.generativemodel.generativemodel.Class>)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GenerativemodelPackage.ASPECT__CLASS_DEPENDENCES:
				getClassDependences().clear();
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GenerativemodelPackage.ASPECT__CLASS_DEPENDENCES:
				return classDependences != null && !classDependences.isEmpty();
		}
		return super.eIsSet(featureID);
	}

} //AspectImpl
